﻿using System.ComponentModel.DataAnnotations;

namespace XieCan.Core.DTO
{
  public partial class AddressSingleModel : BaseSingleModel
  {
    /// <summary>
    /// 所属用户
    /// </summary>
    public AccountListModel? User { get; set; }
    /// <summary>
    /// 收件人姓名
    /// </summary>
    public string? Name { get; set; }
    /// <summary>
    /// 收件人手机号
    /// </summary>
    public string? Phone { get; set; }
    /// <summary>
    /// 省份
    /// </summary>
    public string? Province { get; set; }
    /// <summary>
    /// 城市
    /// </summary>
    public string? City { get; set; }
    /// <summary>
    /// 区域
    /// </summary>
    public string? Area { get; set; }
    /// <summary>
    /// 详细地址
    /// </summary>
    public string? Detail { get; set; }
    /// <summary>
    /// 是否是默认地址
    /// </summary>
    public bool? IsDefault { get; set; }
  }

  public partial class AddressListModel : BaseListModel
  {
    /// <summary>
    /// 所属用户
    /// </summary>
    public AccountListModel? User { get; set; }
    /// <summary>
    /// 收件人姓名
    /// </summary>
    public string? Name { get; set; }
    /// <summary>
    /// 收件人手机号
    /// </summary>
    public string? Phone { get; set; }
    /// <summary>
    /// 省份
    /// </summary>
    public string? Province { get; set; }
    /// <summary>
    /// 城市
    /// </summary>
    public string? City { get; set; }
    /// <summary>
    /// 区域
    /// </summary>
    public string? Area { get; set; }
    /// <summary>
    /// 详细地址
    /// </summary>
    public string? Detail { get; set; }
    /// <summary>
    /// 是否是默认地址
    /// </summary>
    public bool? IsDefault { get; set; }
  }

  public partial class AddressCreateModel : BaseCreateModel
  {
    /// <summary>
    /// 所属用户
    /// </summary>
    [Required(ErrorMessage = "所属用户不能为空")]
    public Guid UserId { get; set; }
    /// <summary>
    /// 收件人姓名
    /// </summary>
    [Required(ErrorMessage = "收件人姓名不能为空")]
    public string? Name { get; set; }
    /// <summary>
    /// 收件人手机号
    /// </summary>
    [Required(ErrorMessage = "收件人手机号不能为空")]
    [RegularExpression("1\\d{10}", ErrorMessage = "手机号不合法")]
    public string? Phone { get; set; }
    /// <summary>
    /// 省份
    /// </summary>
    [Required(ErrorMessage = "省份不能为空")]
    public string? Province { get; set; }
    /// <summary>
    /// 城市
    /// </summary>
    [Required(ErrorMessage = "城市不能为空")]
    public string? City { get; set; }
    /// <summary>
    /// 区域
    /// </summary>
    [Required(ErrorMessage = "区域不能为空")]
    public string? Area { get; set; }
    /// <summary>
    /// 详细地址
    /// </summary>
    [Required(ErrorMessage = "详细地址不能为空")]
    public string? Detail { get; set; }
    /// <summary>
    /// 是否是默认地址
    /// </summary>
    public bool? IsDefault { get; set; }
  }

  public partial class AddressUpdateModel : BaseUpdateModel
  {
    /// <summary>
    /// 所属用户
    /// </summary>
    [Required(ErrorMessage = "所属用户不能为空")]
    public Guid UserId { get; set; }
    /// <summary>
    /// 收件人姓名
    /// </summary>
    [Required(ErrorMessage = "收件人姓名不能为空")]
    public string? Name { get; set; }
    /// <summary>
    /// 收件人手机号
    /// </summary>
    [Required(ErrorMessage = "收件人手机号不能为空")]
    [RegularExpression("1\\d{10}", ErrorMessage = "手机号不合法")]
    public string? Phone { get; set; }
    /// <summary>
    /// 省份
    /// </summary>
    [Required(ErrorMessage = "省份不能为空")]
    public string? Province { get; set; }
    /// <summary>
    /// 城市
    /// </summary>
    [Required(ErrorMessage = "城市不能为空")]
    public string City { get; set; }
    /// <summary>
    /// 区域
    /// </summary>
    [Required(ErrorMessage = "区域不能为空")]
    public string? Area { get; set; }
    /// <summary>
    /// 详细地址
    /// </summary>
    [Required(ErrorMessage = "详细地址不能为空")]
    public string? Detail { get; set; }
    /// <summary>
    /// 是否是默认地址
    /// </summary>
    public bool? IsDefault { get; set; }
  }

}
